/**
 * caicongyang.com Inc.
 * Copyright (c) 2004-2017 All Rights Reserved.
 */
package com.caicongyang.design.decortor;

/**
 *
 * 装饰模式的作用是动态的添加功能：把核心功能和装饰功能分开
 * @author caicongyang1
 * @version id: DecortroClientTest, v 0.1 17/5/13 下午8:04 caicongyang1 Exp $$
 */
public class DecortroClientTest {
    public static void main(String[] args) {
        Component component = new ConcreateComponent();

        ConcreteDecorateA decorateA = new ConcreteDecorateA();

        ConcreteDecorateB decorateB = new ConcreteDecorateB();

        decorateA.setComponent(component);
        decorateB.setComponent(component);

        decorateA.operation();
        decorateA.operation();

    }
}
